<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="/jsp/common/taglibs.jsp"%>
<%@page import="org.ralasafe.WebRalasafe"%>
<%@page import="com.health.common.Constants.Privilege"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>新增用户——管理后台</title>
<%@ include file="/jsp/common/meta.jsp"%>
</head>

<body>
	<div id="container">
    	<%@ include file="/jsp/common/header.jsp"%>
    	<%@ include file="/jsp/main/public/menu.jsp"%>
        <table class="list">
           <thead>
               <tr>
                   <th align="center">编号</th>
                   <th align="center">用户名</th>
                   <th align="center">密码</th>
                   <th align="center">邮箱</th>
                   <th align="center">注册时间</th>
                   <th align="center">上次时间</th>
                   <th align="center">状态</th>
                   <th align="center">操作</th>
               </tr>
           </thead>
	       <s:if test="#request.users!=null">
	           <tbody>
	           <s:iterator id="user" value="#request.users">
	               <tr>
	                   <td align="center">${user.id}</td>
	                   <td align="center">${user.username}</td>
	                   <td align="center">${user.password}</td>
	                   <td align="center">${user.email}</td>
	                   <td align="center">${user.registerTime}</td>
	                   <td align="center">${user.lastLoginTime}</td>
	                   <td align="center">
	                       <s:if test="!#user.isDelete"><span class="green">正常</span></s:if>
	                       <s:else><span class="red">禁用</span></s:else>
	                   </td>
	                   <td align="center">
	                      <%if (WebRalasafe.hasPrivilege(request, Privilege.USER_EDIT)) { %>
	                      <a href="${ctx}/user/to_edit.action?id=${user.id}" class="blue">编辑</a>
	                      <%} %>
	                      <%if (WebRalasafe.hasPrivilege(request, Privilege.USER_DELETE)) { %>
	                      | <a href="${ctx}/user/delete.action?id=${user.id}" class="blue" onclick="return deleteUser();" >删除</a>
	                      <%} %>
	                   </td>
	               </tr>
	           </s:iterator>
	           </tbody>
           </s:if>
        </table>
		<%@ include file="/jsp/common/footer.jsp"%>
	</div>
</body>
<script type="text/javascript">
    function deleteUser() {
    	return confirm('确定要删除记录吗?');
    }
</script>
</html>
